home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.0 / PInterfaces / Sound.p < prev    next >
Encoding:
Text File  |  1995-04-18  |  20.2 KB  |  616 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Sound.p
  3.  
  4.      Contains:    Sound Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT Sound;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __SOUND__}
  30. {$SETC __SOUND__ := 1}
  31.  
  32. {$I+}
  33. {$SETC SoundIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __MIXEDMODE__}
  43. {$I MixedMode.p}
  44. {$ENDC}
  45.  
  46. {$PUSH}
  47. {$ALIGN MAC68K}
  48. {$LibExport+}
  49. {
  50. Interface for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  51.  
  52. These items are no longer defined, but appear here so that someone
  53. searching the interfaces might find them. If you are using one of these
  54. items, you must change your code to support the Sound Manager.
  55.  
  56.     swMode, ftMode, ffMode
  57.     FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  58.     SndCompletionProcPtr
  59.     StartSound, StopSound, SoundDone
  60. }
  61. CONST
  62.     twelfthRootTwo                = 1.05946309434;
  63.     soundListRsrc                = 'snd ';                        {Resource type used by Sound Manager}
  64.     rate44khz                    = $AC440000;                    {44100.00000 in fixed-point}
  65.     rate22050hz                    = $56220000;                    {22050.00000 in fixed-point}
  66.     rate22khz                    = $56EE8BA3;                    {22254.54545 in fixed-point}
  67.     rate11khz                    = $2B7745D1;                    {11127.27273 in fixed-point}
  68.     rate11025hz                    = $2B110000;                    {11025.00000 in fixed-point}
  69. {synthesizer numbers for SndNewChannel}
  70.     squareWaveSynth                = 1;                            {square wave synthesizer}
  71.     waveTableSynth                = 3;                            {wave table synthesizer}
  72.     sampledSynth                = 5;                            {sampled sound synthesizer}
  73. {old Sound Manager MACE synthesizer numbers}
  74.     MACE3snthID                    = 11;
  75.     MACE6snthID                    = 13;
  76.     kMiddleC                    = 60;                            {MIDI note value for middle C}
  77.     kSimpleBeepID                = 1;                            {reserved resource ID for Simple Beep}
  78.     kFullVolume                    = $0100;                        {1.0, setting for full hardware output volume}
  79.     kNoVolume                    = 0;                            {setting for no sound volume}
  80. {command numbers for SndDoCommand and SndDoImmediate}
  81.     nullCmd                        = 0;
  82.     initCmd                        = 1;
  83.     freeCmd                        = 2;
  84.     quietCmd                    = 3;
  85.     flushCmd                    = 4;
  86.     reInitCmd                    = 5;
  87.     waitCmd                        = 10;
  88.     pauseCmd                    = 11;
  89.     resumeCmd                    = 12;
  90.     callBackCmd                    = 13;
  91.  
  92.     syncCmd                        = 14;
  93.     availableCmd                = 24;
  94.     versionCmd                    = 25;
  95.     totalLoadCmd                = 26;
  96.     loadCmd                        = 27;
  97.     freqDurationCmd                = 40;
  98.     restCmd                        = 41;
  99.     freqCmd                        = 42;
  100.     ampCmd                        = 43;
  101.     timbreCmd                    = 44;
  102.     getAmpCmd                    = 45;
  103.     volumeCmd                    = 46;                            {sound manager 3.0 or later only}
  104.     getVolumeCmd                = 47;                            {sound manager 3.0 or later only}
  105.     waveTableCmd                = 60;
  106.     phaseCmd                    = 61;
  107.  
  108.     soundCmd                    = 80;
  109.     bufferCmd                    = 81;
  110.     rateCmd                        = 82;
  111.     continueCmd                    = 83;
  112.     doubleBufferCmd                = 84;
  113.     getRateCmd                    = 85;
  114.     rateMultiplierCmd            = 86;
  115.     getRateMultiplierCmd        = 87;
  116.     sizeCmd                        = 90;
  117.     convertCmd                    = 91;
  118.     stdQLength                    = 128;
  119.     dataOffsetFlag                = $8000;
  120.  
  121. {channel initialization parameters}
  122. {$IFC OLDROUTINENAMES }
  123.     waveInitChannelMask            = $07;
  124.     waveInitChannel0            = $04;                            {wave table only, Sound Manager 2.0 and earlier}
  125.     waveInitChannel1            = $05;                            {wave table only, Sound Manager 2.0 and earlier}
  126.     waveInitChannel2            = $06;                            {wave table only, Sound Manager 2.0 and earlier}
  127.     waveInitChannel3            = $07;                            {wave table only, Sound Manager 2.0 and earlier}
  128.     initChan0                    = waveInitChannel0;                {obsolete spelling}
  129.     initChan1                    = waveInitChannel1;                {obsolete spelling}
  130.     initChan2                    = waveInitChannel2;                {obsolete spelling}
  131.     initChan3                    = waveInitChannel3;                {obsolete spelling}
  132.  
  133. {$ENDC}
  134.     initChanLeft                = $0002;                        {left stereo channel}
  135.     initChanRight                = $0003;                        {right stereo channel}
  136.     initNoInterp                = $0004;                        {no linear interpolation}
  137.     initNoDrop                    = $0008;                        {no drop-sample conversion}
  138.     initMono                    = $0080;                        {monophonic channel}
  139.     initStereo                    = $00C0;                        {stereo channel}
  140.     initMACE3                    = $0300;                        {MACE 3:1}
  141.     initMACE6                    = $0400;                        {MACE 6:1}
  142.     initPanMask                    = $0003;                        {mask for right/left pan values}
  143.     initSRateMask                = $0030;                        {mask for sample rate values}
  144.     initStereoMask                = $00C0;                        {mask for mono/stereo values}
  145.     initCompMask                = $FF00;                        {mask for compression IDs}
  146.     kUseOptionalOutputDevice    = -1;                            {only for Sound Manager 3.0 or later}
  147.     notCompressed                = 0;                            {compression ID's}
  148.     fixedCompression            = -1;                            {compression ID for fixed-sized compression}
  149.     variableCompression            = -2;                            {compression ID for variable-sized compression}
  150.     twoToOne                    = 1;
  151.     eightToThree                = 2;
  152.     threeToOne                    = 3;
  153.     sixToOne                    = 4;
  154.  
  155.     stdSH                        = $00;                            {Standard sound header encode value}
  156.     extSH                        = $FF;                            {Extended sound header encode value}
  157.     cmpSH                        = $FE;                            {Compressed sound header encode value}
  158.  
  159.     outsideCmpSH                = 0;                            {MACE constants}
  160.     insideCmpSH                    = 1;
  161.     aceSuccess                    = 0;
  162.     aceMemFull                    = 1;
  163.     aceNilBlock                    = 2;
  164.     aceBadComp                    = 3;
  165.     aceBadEncode                = 4;
  166.     aceBadDest                    = 5;
  167.     aceBadCmd                    = 6;
  168.     sixToOnePacketSize            = 8;
  169.     threeToOnePacketSize        = 16;
  170.     stateBlockSize                = 64;
  171.     leftOverBlockSize            = 32;
  172.     firstSoundFormat            = $0001;                        {general sound format}
  173.     secondSoundFormat            = $0002;                        {special sampled sound format (HyperCard)}
  174.     dbBufferReady                = $00000001;                    {double buffer is filled}
  175.     dbLastBuffer                = $00000004;                    {last double buffer to play}
  176.     sysBeepDisable                = $0000;                        {SysBeep() enable flags}
  177.     sysBeepEnable                = $0001;
  178.     unitTypeNoSelection            = $FFFF;                        {unitTypes for AudioSelection.unitType}
  179.     unitTypeSeconds                = $0000;
  180.  
  181. { unsigned fixed-point number }
  182.     
  183. TYPE
  184.     UnsignedFixed = LONGINT;
  185.  
  186.     SndCommand = PACKED RECORD
  187.         cmd:                    INTEGER;
  188.         param1:                    INTEGER;
  189.         param2:                    LONGINT;
  190.     END;
  191.  
  192.     SndChannelPtr = ^SndChannel;
  193.  
  194.     SndCallBackProcPtr = ProcPtr;  { PROCEDURE SndCallBack(chan: SndChannelPtr; VAR cmd: SndCommand); }
  195.     SndCallBackUPP = UniversalProcPtr;
  196.  
  197.     SndChannel = PACKED RECORD
  198.         nextChan:                ^SndChannel;
  199.         firstMod:                Ptr;                                    { reserved for the Sound Manager }
  200.         callBack:                SndCallBackUPP;
  201.         userInfo:                LONGINT;
  202.         wait:                    LONGINT;                                { The following is for internal Sound Manager use only.}
  203.         cmdInProgress:            SndCommand;
  204.         flags:                    INTEGER;
  205.         qLength:                INTEGER;
  206.         qHead:                    INTEGER;
  207.         qTail:                    INTEGER;
  208.         queue:                    ARRAY [0..stdQLength-1] OF SndCommand;
  209.     END;
  210.  
  211. {MACE structures}
  212.     StateBlock = RECORD
  213.         stateVar:                ARRAY [0..stateBlockSize-1] OF INTEGER;
  214.     END;
  215.  
  216.     StateBlockPtr = ^StateBlock;
  217.  
  218.     LeftOverBlock = RECORD
  219.         count:                    LONGINT;
  220.         sampleArea:                PACKED ARRAY [0..leftOverBlockSize-1] OF CHAR;
  221.     END;
  222.  
  223.     LeftOverBlockPtr = ^LeftOverBlock;
  224.  
  225.     ModRef = RECORD
  226.         modNumber:                INTEGER;
  227.         modInit:                LONGINT;
  228.     END;
  229.  
  230.     SndListResource = RECORD
  231.         format:                    INTEGER;
  232.         numModifiers:            INTEGER;
  233.         modifierPart:            ARRAY [0..0] OF ModRef;                    {This is a variable length array}
  234.         numCommands:            INTEGER;
  235.         commandPart:            ARRAY [0..0] OF SndCommand;                {This is a variable length array}
  236.         dataPart:                PACKED ARRAY [0..0] OF CHAR;            {This is a variable length array}
  237.     END;
  238.  
  239.     SndListPtr = ^SndListResource;
  240.  
  241.     SndListHndl = ^SndListPtr;
  242.     SndListHandle = ^SndListPtr;
  243.  
  244. {HyperCard sound resource format}
  245.     Snd2ListResource = RECORD
  246.         format:                    INTEGER;
  247.         refCount:                INTEGER;
  248.         numCommands:            INTEGER;
  249.         commandPart:            ARRAY [0..0] OF SndCommand;                {This is a variable length array}
  250.         dataPart:                PACKED ARRAY [0..0] OF CHAR;            {This is a variable length array}
  251.     END;
  252.  
  253.     Snd2ListPtr = ^Snd2ListResource;
  254.  
  255.     Snd2ListHndl = ^Snd2ListPtr;
  256.     Snd2ListHandle = ^Snd2ListPtr;
  257.  
  258.     SoundHeader = PACKED RECORD
  259.         samplePtr:                Ptr;                                    {if NIL then samples are in sampleArea}
  260.         length:                    LONGINT;                                {length of sound in bytes}
  261.         sampleRate:                UnsignedFixed;                            {sample rate for this sound}
  262.         loopStart:                LONGINT;                                {start of looping portion}
  263.         loopEnd:                LONGINT;                                {end of looping portion}
  264.         encode:                    CHAR;                                    {header encoding}
  265.         baseFrequency:            CHAR;                                    {baseFrequency value}
  266.         sampleArea:                PACKED ARRAY [0..0] OF CHAR;            {space for when samples follow directly}
  267.     END;
  268.  
  269.     SoundHeaderPtr = ^SoundHeader;
  270.  
  271.     CmpSoundHeader = PACKED RECORD
  272.         samplePtr:                Ptr;                                    {if nil then samples are in sample area}
  273.         numChannels:            LONGINT;                                {number of channels i.e. mono = 1}
  274.         sampleRate:                UnsignedFixed;                            {sample rate in Apples Fixed point representation}
  275.         loopStart:                LONGINT;                                {loopStart of sound before compression}
  276.         loopEnd:                LONGINT;                                {loopEnd of sound before compression}
  277.         encode:                    CHAR;                                    {data structure used , stdSH, extSH, or cmpSH}
  278.         baseFrequency:            CHAR;                                    {same meaning as regular SoundHeader}
  279.         numFrames:                LONGINT;                                {length in frames ( packetFrames or sampleFrames )}
  280.         AIFFSampleRate:            extended80;                                {IEEE sample rate}
  281.         markerChunk:            Ptr;                                    {sync track}
  282.         format:                    OSType;                                    {data format type, was futureUse1}
  283.         futureUse2:                LONGINT;                                {reserved by Apple}
  284.         stateVars:                StateBlockPtr;                            {pointer to State Block}
  285.         leftOverSamples:        LeftOverBlockPtr;                        {used to save truncated samples between compression calls}
  286.         compressionID:            INTEGER;                                {0 means no compression, non zero means compressionID}
  287.         packetSize:                INTEGER;                                {number of bits in compressed sample packet}
  288.         snthID:                    INTEGER;                                {resource ID of Sound Manager snth that contains NRT C/E}
  289.         sampleSize:                INTEGER;                                {number of bits in non-compressed sample}
  290.         sampleArea:                PACKED ARRAY [0..0] OF CHAR;            {space for when samples follow directly}
  291.     END;
  292.  
  293.     CmpSoundHeaderPtr = ^CmpSoundHeader;
  294.  
  295.     ExtSoundHeader = PACKED RECORD
  296.         samplePtr:                Ptr;                                    {if nil then samples are in sample area}
  297.         numChannels:            LONGINT;                                {number of channels,  ie mono = 1}
  298.         sampleRate:                UnsignedFixed;                            {sample rate in Apples Fixed point representation}
  299.         loopStart:                LONGINT;                                {same meaning as regular SoundHeader}
  300.         loopEnd:                LONGINT;                                {same meaning as regular SoundHeader}
  301.         encode:                    CHAR;                                    {data structure used , stdSH, extSH, or cmpSH}
  302.         baseFrequency:            CHAR;                                    {same meaning as regular SoundHeader}
  303.         numFrames:                LONGINT;                                {length in total number of frames}
  304.         AIFFSampleRate:            extended80;                                {IEEE sample rate}
  305.         markerChunk:            Ptr;                                    {sync track}
  306.         instrumentChunks:        Ptr;                                    {AIFF instrument chunks}
  307.         AESRecording:            Ptr;
  308.         sampleSize:                INTEGER;                                {number of bits in sample}
  309.         futureUse1:                INTEGER;                                {reserved by Apple}
  310.         futureUse2:                LONGINT;                                {reserved by Apple}
  311.         futureUse3:                LONGINT;                                {reserved by Apple}
  312.         futureUse4:                LONGINT;                                {reserved by Apple}
  313.         sampleArea:                PACKED ARRAY [0..0] OF CHAR;            {space for when samples follow directly}
  314.     END;
  315.  
  316.     ExtSoundHeaderPtr = ^ExtSoundHeader;
  317.  
  318.     ConversionBlock = RECORD
  319.         destination:            INTEGER;
  320.         unused:                    INTEGER;
  321.         inputPtr:                CmpSoundHeaderPtr;
  322.         outputPtr:                CmpSoundHeaderPtr;
  323.     END;
  324.  
  325.     ConversionBlockPtr = ^ConversionBlock;
  326.  
  327.     SMStatus = PACKED RECORD
  328.         smMaxCPULoad:            INTEGER;
  329.         smNumChannels:            INTEGER;
  330.         smCurCPULoad:            INTEGER;
  331.     END;
  332.  
  333.     SMStatusPtr = ^SMStatus;
  334.  
  335.     SCStatus = RECORD
  336.         scStartTime:            UnsignedFixed;
  337.         scEndTime:                UnsignedFixed;
  338.         scCurrentTime:            UnsignedFixed;
  339.         scChannelBusy:            BOOLEAN;
  340.         scChannelDisposed:        BOOLEAN;
  341.         scChannelPaused:        BOOLEAN;
  342.         scUnused:                BOOLEAN;
  343.         scChannelAttributes:    LONGINT;
  344.         scCPULoad:                LONGINT;
  345.     END;
  346.  
  347.     SCStatusPtr = ^SCStatus;
  348.  
  349.     AudioSelection = PACKED RECORD
  350.         unitType:                LONGINT;
  351.         selStart:                UnsignedFixed;
  352.         selEnd:                    UnsignedFixed;
  353.     END;
  354.  
  355.     FilePlayCompletionProcPtr = ProcPtr;  { PROCEDURE FilePlayCompletion(chan: SndChannelPtr); }
  356.     FilePlayCompletionUPP = UniversalProcPtr;
  357.  
  358. CONST
  359.     uppFilePlayCompletionProcInfo = $000000C0; { PROCEDURE (4 byte param); }
  360.  
  361. FUNCTION NewFilePlayCompletionProc(userRoutine: FilePlayCompletionProcPtr): FilePlayCompletionUPP;
  362.     {$IFC NOT GENERATINGCFM }
  363.     INLINE $2E9F;
  364.     {$ENDC}
  365.  
  366. PROCEDURE CallFilePlayCompletionProc(chan: SndChannelPtr; userRoutine: FilePlayCompletionUPP);
  367.     {$IFC NOT GENERATINGCFM}
  368.     INLINE $205F, $4E90;
  369.     {$ENDC}
  370.     
  371. TYPE
  372.     AudioSelectionPtr = ^AudioSelection;
  373.  
  374.     SndDoubleBuffer = PACKED RECORD
  375.         dbNumFrames:            LONGINT;
  376.         dbFlags:                LONGINT;
  377.         dbUserInfo:                ARRAY [0..1] OF LONGINT;
  378.         dbSoundData:            PACKED ARRAY [0..0] OF CHAR;
  379.     END;
  380.  
  381.     SndDoubleBufferPtr = ^SndDoubleBuffer;
  382.  
  383.     SndDoubleBackProcPtr = ProcPtr;  { PROCEDURE SndDoubleBack(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr); }
  384.     SndDoubleBackUPP = UniversalProcPtr;
  385.  
  386. CONST
  387.     uppSndDoubleBackProcInfo = $000003C0; { PROCEDURE (4 byte param, 4 byte param); }
  388.  
  389. FUNCTION NewSndDoubleBackProc(userRoutine: SndDoubleBackProcPtr): SndDoubleBackUPP;
  390.     {$IFC NOT GENERATINGCFM }
  391.     INLINE $2E9F;
  392.     {$ENDC}
  393.  
  394. PROCEDURE CallSndDoubleBackProc(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr; userRoutine: SndDoubleBackUPP);
  395.     {$IFC NOT GENERATINGCFM}
  396.     INLINE $205F, $4E90;
  397.     {$ENDC}
  398.  
  399. TYPE
  400.     SndDoubleBufferHeader = PACKED RECORD
  401.         dbhNumChannels:            INTEGER;
  402.         dbhSampleSize:            INTEGER;
  403.         dbhCompressionID:        INTEGER;
  404.         dbhPacketSize:            INTEGER;
  405.         dbhSampleRate:            UnsignedFixed;
  406.         dbhBufferPtr:            ARRAY [0..1] OF SndDoubleBufferPtr;
  407.         dbhDoubleBack:            SndDoubleBackUPP;
  408.     END;
  409.  
  410.     SndDoubleBufferHeaderPtr = ^SndDoubleBufferHeader;
  411.  
  412.     SndDoubleBufferHeader2 = PACKED RECORD
  413.         dbhNumChannels:            INTEGER;
  414.         dbhSampleSize:            INTEGER;
  415.         dbhCompressionID:        INTEGER;
  416.         dbhPacketSize:            INTEGER;
  417.         dbhSampleRate:            UnsignedFixed;
  418.         dbhBufferPtr:            ARRAY [0..1] OF SndDoubleBufferPtr;
  419.         dbhDoubleBack:            SndDoubleBackUPP;
  420.         dbhFormat:                OSType;
  421.     END;
  422.  
  423.     SndDoubleBufferHeader2Ptr = ^SndDoubleBufferHeader2;
  424.  
  425.     SoundInfoList = PACKED RECORD
  426.         count:                    INTEGER;
  427.         infoHandle:                Handle;
  428.     END;
  429.  
  430.     SoundInfoListPtr = ^SoundInfoList;
  431.  
  432.     CompressionInfo = RECORD
  433.         recordSize:                LONGINT;
  434.         format:                    OSType;
  435.         compressionID:            INTEGER;
  436.         samplesPerPacket:        INTEGER;
  437.         bytesPerPacket:            INTEGER;
  438.         bytesPerFrame:            INTEGER;
  439.         bytesPerSample:            INTEGER;
  440.         futureUse1:                INTEGER;
  441.     END;
  442.  
  443.     CompressionInfoPtr = ^CompressionInfo;
  444.  
  445.     CompressionInfoHandle = ^CompressionInfoPtr;
  446.  
  447. { These two routines for Get/SetSoundVol should no longer be used.}
  448. { They were for old Apple Sound Chip machines, and do not support the DSP or PowerMacs.}
  449. { Use Get/SetDefaultOutputVolume instead, if you must change the user's machine.}
  450. {$IFC OLDROUTINENAMES  & NOT GENERATINGCFM }
  451.  
  452. PROCEDURE SetSoundVol(level: INTEGER);
  453. PROCEDURE GetSoundVol(VAR level: INTEGER);
  454.     {$IFC NOT GENERATINGCFM}
  455.     INLINE $205F, $4218, $10B8, $0260;
  456.     {$ENDC}
  457. {$ENDC}
  458.  
  459. FUNCTION SndDoCommand(chan: SndChannelPtr; {CONST}VAR cmd: SndCommand; noWait: BOOLEAN): OSErr;
  460.     {$IFC NOT GENERATINGCFM}
  461.     INLINE $A803;
  462.     {$ENDC}
  463. FUNCTION SndDoImmediate(chan: SndChannelPtr; {CONST}VAR cmd: SndCommand): OSErr;
  464.     {$IFC NOT GENERATINGCFM}
  465.     INLINE $A804;
  466.     {$ENDC}
  467. FUNCTION SndNewChannel(VAR chan: SndChannelPtr; synth: INTEGER; init: LONGINT; userRoutine: SndCallBackUPP): OSErr;
  468.     {$IFC NOT GENERATINGCFM}
  469.     INLINE $A807;
  470.     {$ENDC}
  471. FUNCTION SndDisposeChannel(chan: SndChannelPtr; quietNow: BOOLEAN): OSErr;
  472.     {$IFC NOT GENERATINGCFM}
  473.     INLINE $A801;
  474.     {$ENDC}
  475. FUNCTION SndPlay(chan: SndChannelPtr; sndHdl: SndListHandle; async: BOOLEAN): OSErr;
  476.     {$IFC NOT GENERATINGCFM}
  477.     INLINE $A805;
  478.     {$ENDC}
  479. {$IFC OLDROUTINENAMES }
  480. FUNCTION SndAddModifier(chan: SndChannelPtr; modifier: Ptr; id: INTEGER; init: LONGINT): OSErr;
  481.     {$IFC NOT GENERATINGCFM}
  482.     INLINE $A802;
  483.     {$ENDC}
  484. {$ENDC}
  485. FUNCTION SndControl(id: INTEGER; VAR cmd: SndCommand): OSErr;
  486.     {$IFC NOT GENERATINGCFM}
  487.     INLINE $A806;
  488.     {$ENDC}
  489. { Sound Manager 2.0 and later, uses _SoundDispatch }
  490. FUNCTION SndSoundManagerVersion: NumVersion;
  491.     {$IFC NOT GENERATINGCFM}
  492.     INLINE $203C, $000C, $0008, $A800;
  493.     {$ENDC}
  494. FUNCTION SndStartFilePlay(chan: SndChannelPtr; fRefNum: INTEGER; resNum: INTEGER; bufferSize: LONGINT; theBuffer: UNIV Ptr; theSelection: AudioSelectionPtr; theCompletion: FilePlayCompletionUPP; async: BOOLEAN): OSErr;
  495.     {$IFC NOT GENERATINGCFM}
  496.     INLINE $203C, $0D00, $0008, $A800;
  497.     {$ENDC}
  498. FUNCTION SndPauseFilePlay(chan: SndChannelPtr): OSErr;
  499.     {$IFC NOT GENERATINGCFM}
  500.     INLINE $203C, $0204, $0008, $A800;
  501.     {$ENDC}
  502. FUNCTION SndStopFilePlay(chan: SndChannelPtr; quietNow: BOOLEAN): OSErr;
  503.     {$IFC NOT GENERATINGCFM}
  504.     INLINE $203C, $0308, $0008, $A800;
  505.     {$ENDC}
  506. FUNCTION SndChannelStatus(chan: SndChannelPtr; theLength: INTEGER; theStatus: SCStatusPtr): OSErr;
  507.     {$IFC NOT GENERATINGCFM}
  508.     INLINE $203C, $0510, $0008, $A800;
  509.     {$ENDC}
  510. FUNCTION SndManagerStatus(theLength: INTEGER; theStatus: SMStatusPtr): OSErr;
  511.     {$IFC NOT GENERATINGCFM}
  512.     INLINE $203C, $0314, $0008, $A800;
  513.     {$ENDC}
  514. PROCEDURE SndGetSysBeepState(VAR sysBeepState: INTEGER);
  515.     {$IFC NOT GENERATINGCFM}
  516.     INLINE $203C, $0218, $0008, $A800;
  517.     {$ENDC}
  518. FUNCTION SndSetSysBeepState(sysBeepState: INTEGER): OSErr;
  519.     {$IFC NOT GENERATINGCFM}
  520.     INLINE $203C, $011C, $0008, $A800;
  521.     {$ENDC}
  522. FUNCTION SndPlayDoubleBuffer(chan: SndChannelPtr; theParams: SndDoubleBufferHeaderPtr): OSErr;
  523.     {$IFC NOT GENERATINGCFM}
  524.     INLINE $203C, $0420, $0008, $A800;
  525.     {$ENDC}
  526. { MACE compression routines }
  527. FUNCTION MACEVersion: NumVersion;
  528.     {$IFC NOT GENERATINGCFM}
  529.     INLINE $203C, $0000, $0010, $A800;
  530.     {$ENDC}
  531. PROCEDURE Comp3to1(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  532.     {$IFC NOT GENERATINGCFM}
  533.     INLINE $203C, $0004, $0010, $A800;
  534.     {$ENDC}
  535. PROCEDURE Exp1to3(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  536.     {$IFC NOT GENERATINGCFM}
  537.     INLINE $203C, $0008, $0010, $A800;
  538.     {$ENDC}
  539. PROCEDURE Comp6to1(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  540.     {$IFC NOT GENERATINGCFM}
  541.     INLINE $203C, $000C, $0010, $A800;
  542.     {$ENDC}
  543. PROCEDURE Exp1to6(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  544.     {$IFC NOT GENERATINGCFM}
  545.     INLINE $203C, $0010, $0010, $A800;
  546.     {$ENDC}
  547. { Sound Manager 3.0 and later calls }
  548. FUNCTION GetSysBeepVolume(VAR level: LONGINT): OSErr;
  549.     {$IFC NOT GENERATINGCFM}
  550.     INLINE $203C, $0224, $0018, $A800;
  551.     {$ENDC}
  552. FUNCTION SetSysBeepVolume(level: LONGINT): OSErr;
  553.     {$IFC NOT GENERATINGCFM}
  554.     INLINE $203C, $0228, $0018, $A800;
  555.     {$ENDC}
  556. FUNCTION GetDefaultOutputVolume(VAR level: LONGINT): OSErr;
  557.     {$IFC NOT GENERATINGCFM}
  558.     INLINE $203C, $022C, $0018, $A800;
  559.     {$ENDC}
  560. FUNCTION SetDefaultOutputVolume(level: LONGINT): OSErr;
  561.     {$IFC NOT GENERATINGCFM}
  562.     INLINE $203C, $0230, $0018, $A800;
  563.     {$ENDC}
  564. FUNCTION GetSoundHeaderOffset(sndHandle: SndListHandle; VAR offset: LONGINT): OSErr;
  565.     {$IFC NOT GENERATINGCFM}
  566.     INLINE $203C, $0404, $0018, $A800;
  567.     {$ENDC}
  568. FUNCTION UnsignedFixedMulDiv(value: UnsignedFixed; multiplier: UnsignedFixed; divisor: UnsignedFixed): UnsignedFixed;
  569.     {$IFC NOT GENERATINGCFM}
  570.     INLINE $203C, $060C, $0018, $A800;
  571.     {$ENDC}
  572. FUNCTION GetCompressionInfo(compressionID: INTEGER; format: OSType; numChannels: INTEGER; sampleSize: INTEGER; cp: CompressionInfoPtr): OSErr;
  573.     {$IFC NOT GENERATINGCFM}
  574.     INLINE $203C, $0710, $0018, $A800;
  575.     {$ENDC}
  576. FUNCTION SetSoundPreference(theType: OSType; VAR name: Str255; settings: Handle): OSErr;
  577.     {$IFC NOT GENERATINGCFM}
  578.     INLINE $203C, $0634, $0018, $A800;
  579.     {$ENDC}
  580. FUNCTION GetSoundPreference(theType: OSType; VAR name: Str255; settings: Handle): OSErr;
  581.     {$IFC NOT GENERATINGCFM}
  582.     INLINE $203C, $0638, $0018, $A800;
  583.     {$ENDC}
  584. { Sound Manager 3.1 and later calls }
  585. FUNCTION SndGetInfo(chan: SndChannelPtr; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  586.     {$IFC NOT GENERATINGCFM}
  587.     INLINE $203C, $063C, $0018, $A800;
  588.     {$ENDC}
  589. FUNCTION SndSetInfo(chan: SndChannelPtr; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  590.     {$IFC NOT GENERATINGCFM}
  591.     INLINE $203C, $0640, $0018, $A800;
  592.     {$ENDC}
  593. CONST
  594.     uppSndCallBackProcInfo = $000003C0; { PROCEDURE (4 byte param, 4 byte param); }
  595.  
  596. FUNCTION NewSndCallBackProc(userRoutine: SndCallBackProcPtr): SndCallBackUPP;
  597.     {$IFC NOT GENERATINGCFM }
  598.     INLINE $2E9F;
  599.     {$ENDC}
  600.  
  601. PROCEDURE CallSndCallBackProc(chan: SndChannelPtr; VAR cmd: SndCommand; userRoutine: SndCallBackUPP);
  602.     {$IFC NOT GENERATINGCFM}
  603.     INLINE $205F, $4E90;
  604.     {$ENDC}
  605.  
  606. {$ALIGN RESET}
  607. {$POP}
  608.  
  609. {$SETC UsingIncludes := SoundIncludes}
  610.  
  611. {$ENDC} {__SOUND__}
  612.  
  613. {$IFC NOT UsingIncludes}
  614.  END.
  615. {$ENDC}
  616.